function SiteEntry(resource, datasource) 
{
	this.superClass = DatabaseEntry;
	this.superClass(resource, datasource);
}

SiteEntry.prototype = new DatabaseEntry;
SiteEntry.prototype.sessionExists = function SE_sessionExists(date) {
	var dateRes = Database._generateDateResource(date);
	return this.containsByProperty(Database.dateProp, dateRes);
}

SiteEntry.prototype.getSiteId = function SE_getSiteId() {
	var siteIdLiteral = this._datasource.GetTarget(this.resource, Database.hostProp, true);
	if (siteIdLiteral instanceof CI.nsIRDFLiteral) {
		return siteIdLiteral.Value;
	}
}

SiteEntry.prototype.getSessionDuration = function SE_getSessionDuration(date) {
	var result = 0;
	var session = this.sessionExists(date);
	if (session != null) {
		var durationLit = this._datasource.GetTarget(session, Database.durationProp, true);
		if (durationLit instanceof CI.nsIRDFInt)
			result = durationLit.Value;
	}
	return result;
}

SiteEntry.prototype.updateSessionDuration = function SE_updateSessionEntry(date, duration) {
	duration = (duration < 0) ? 0 : duration;
	
	var dateLiteral = Database.rdf.GetLiteral(date);
	var durationLiteral = Database.rdf.GetIntLiteral(duration);
	var session = this.sessionExists(date);
	if (session != null) {
		Database.dsUpdate(this._datasource, session, Database.durationProp, durationLiteral);
	}
}
